<html lang="en">
<head>
    <meta charset="utf-8">
    <title>核酸系统管理中心</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="" name="keywords">
    <meta content="" name="description">
    <link rel="preconnect" href="https://fonts.googleapis.com/">
    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin="">
    <link href="../static/css/all.min.css" rel="stylesheet">
    <link href="../static/css/bootstrap-icons.css" rel="stylesheet">
    <link href="../static/css/owl.carousel.min.css" rel="stylesheet">
    <link href="../static/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet">
    <link href="../static/css/bootstrap.min.css" rel="stylesheet">
    <link href="../static/css/style.css" rel="stylesheet">
    {% block style %}
{% endblock %}
</head>

<body style="background: #ccc">

<div class="container-fluid position-relative d-flex p-0">
    <div id="spinner"
         class="show bg-dark position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
        <div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
            <span class="sr-only">加载中...</span>
        </div>
    </div>
    <div class="sidebar pe-4 pb-3">
        <nav class="navbar bg-secondary navbar-dark">
            <a href="index.html" class="navbar-brand mx-4 mb-3">
                <h3 class="text-primary"><i class="fa fa-user-edit me-2">核酸检测系统</i></h3>
            </a>
            <div class="d-flex align-items-center ms-4 mb-4">
                <div class="position-relative">
                    <img class="rounded-circle" src="../static/picture/user.jpg" alt="" style="width: 40px; height: 40px;">
                    <div class="bg-success rounded-circle border border-2 border-white position-absolute end-0 bottom-0 p-1"></div>
                </div>
                <div class="ms-3">
                    <h6 class="mb-0">{{ username }}</h6>
                    <span></span>
                </div>
            </div>
            <div class="navbar-nav w-100">
             {% if role == 1 %}
                <a href="/index" class="nav-item nav-link" id="index"><i class="fa fa-tachometer-alt me-2"></i>首页</a>
                <a href="/dengji" class="nav-item nav-link" id="dengji" target="_blank"><i class="fa fa-th me-2"></i>检测管理</a>
                   <a href="/user/user" class="nav-item nav-link" id="user"><i class="fa fa-chart-bar me-2"></i>用户管理</a>
                 <a href="/user/user_jg" class="nav-item nav-link" id="user_jg"><i class="fa fa-chart-bar me-2"></i>机构管理</a>
                 <a href="/get_database" class="nav-item nav-link" id="get_database"><i class="fa fa-chart-bar me-2"></i>核酸统计</a>
                <a href="/feedback" class="nav-item nav-link" id="feedback"><i class="fa fa-chart-bar me-2"></i>反馈管理</a>
                <a href="/user/password" class="nav-item nav-link" id="password"><i class="fa fa-keyboard me-2"></i>修改密码</a>
                <a href="/user/personal" class="nav-item nav-link" id="personal"><i class="fa fa-table me-2"></i>个人信息</a>
               {% endif %}

                {% if role == 3 %}
                <a href="/index" class="nav-item nav-link" id="index"><i class="fa fa-tachometer-alt me-2"></i>首页</a>
                <a href="/dengji" class="nav-item nav-link" id="dengji" target="_blank"><i class="fa fa-th me-2"></i>检测管理</a>
                <a href="/feedback" class="nav-item nav-link" id="feedback"><i class="fa fa-chart-bar me-2"></i>反馈管理</a>
                <a href="/user/user_jg" class="nav-item nav-link" id="user"><i class="fa fa-chart-bar me-2"></i>机构列表</a>
                <a href="/user/password" class="nav-item nav-link" id="password"><i class="fa fa-keyboard me-2"></i>修改密码</a>
                <a href="/user/personal" class="nav-item nav-link" id="personal"><i class="fa fa-table me-2"></i>个人信息</a>
                {% endif %}


               {% if role == 2 %}
                <a href="/index" class="nav-item nav-link" id="index"><i class="fa fa-tachometer-alt me-2"></i>首页</a>
                <a href="/dengji" class="nav-item nav-link" id="dengji" target="_blank"><i class="fa fa-th me-2"></i>检测管理</a>
                 <a href="/user/user_jg" class="nav-item nav-link" id="user"><i class="fa fa-chart-bar me-2"></i>机构列表</a>
                <a href="/feedback" class="nav-item nav-link" id="feedback"><i class="fa fa-chart-bar me-2"></i>反馈管理</a>
                <a href="/user/password" class="nav-item nav-link" id="password"><i class="fa fa-keyboard me-2"></i>修改密码</a>
                <a href="/user/personal" class="nav-item nav-link" id="personal"><i class="fa fa-table me-2"></i>个人信息</a>
                {% endif %}
            </div>
        </nav>
    </div>


    <div class="content">

        <nav class="navbar navbar-expand bg-secondary navbar-dark sticky-top px-4 py-0">
            <a href="index.html" class="navbar-brand d-flex d-lg-none me-4">
                <h2 class="text-primary mb-0"><i class="fa fa-user-edit"></i></h2>
            </a>
          
            <div class="navbar-nav align-items-center ms-auto">
                <div class="nav-item dropdown">
                    <a href="#" class="nav-link -" data-bs-toggle="dropdown">
                        <img class="rounded-circle me-lg-2" src="../static/picture/user.jpg" alt=""
                             style="width: 40px; height: 40px;">
                        <span class="d-none d-lg-inline-flex"> {% if role == 1 %}  超级管理员     {% endif %}
                             {% if role == 2 %}  医疗机构    {% endif %}    {% if role == 3 %} 市民    {% endif %}
                | {{ username }}
               </span>
                    </a>
                </div>
                 <div class="nav-item ">
                    <a href="/login_out" class="nav-link " >
                        退出登录
                    </a>

                </div>
            </div>
        </nav>
        {% block content %}


        {% endblock %}
    </div>


    <a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
</div>

<!-- <script src="../static/js/jquery.min.js" type="text/javascript"></script> -->
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> 
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="../static/js/main.js" type="text/javascript"></script>
</body>
{% block script %}
{% endblock %}
<script>
    let currentElemt = window.location.pathname;
    console.log(currentElemt)
    // nav菜单选择
    if (currentElemt.indexOf('password') > -1) {
        currentElemt = 'password'
    } else if (currentElemt.indexOf('index2') > -1) {
        currentElemt = 'index2'
    } else if (currentElemt.indexOf('database_info') > -1) {
        currentElemt = 'database_info'
    } else if (currentElemt.indexOf('/user/personal') > -1) {
        currentElemt = '/user/personal'
    } else if (currentElemt.indexOf('user/user') > -1) {
        currentElemt = '/user/user'
    } else if (currentElemt.indexOf('index') > -1) {
        currentElemt = 'index'
    }else if (currentElemt.indexOf('dengji') > -1) {
        currentElemt = 'dengji'
    } else if (currentElemt.indexOf('feedback') > -1) {
        currentElemt = 'feedback'
    } else if (currentElemt.indexOf('get_database') > -1) {
        currentElemt = 'get_database'
    } 
    else if (currentElemt.indexOf('user_jg') > -1) {
        currentElemt = '/user/user_jg'
    } 
    $('#' + currentElemt).addClass('active');
</script>
</html>